package cn.ycc1.iterator.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

/**
 * @author ycc
 * @date 2023/12/9
 */
@RestController
@Slf4j
public class TestController {

    @GetMapping("/test")
    public String test() {

        Integer[] arr = {1, 2, 3, 4, 5};
        List<Integer> list = Arrays.asList(arr);

        Iterator<Integer> it = list.iterator();
        while (it.hasNext()) {
            System.out.println(it.next());
        }

        return "hello test";
    }
}
